package hongcaosp.app.android.contact.atme;

import android.content.Context;
import android.media.Image;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.target.ImageViewTarget;

import hongcaosp.app.android.R;
import hongcaosp.app.android.common.BaseHolder;
import hongcaosp.app.android.modle.bean.IAtme;
import xlj.lib.android.base.utils.GlideUtils;
import xlj.lib.android.base.view.CircleImageView;

public class AtmeHolder extends BaseHolder<IAtme> {
    private Context context;
    private ImageView userLogoIV;
    private TextView userNameTV,timeTV,descripTV;
    private ImageView videoCoverIV;

    public AtmeHolder(View itemView, Context context) {
        super(itemView);
        this.context = context;

        userLogoIV = itemView.findViewById(R.id.user_logo);
        userNameTV = itemView.findViewById(R.id.user_name);
        timeTV = itemView.findViewById(R.id.fan_time);
        descripTV = itemView.findViewById(R.id.descrip);
        videoCoverIV = itemView.findViewById(R.id.video_cover);
        descripTV.setText("@我");
    }

    @Override
    public void setData(final IAtme iAtme) {
        GlideUtils.loadCircleImage(context,iAtme.getImage(),userLogoIV,R.drawable.icon_head);
        userNameTV.setText(iAtme.getNickname());
        timeTV.setText(iAtme.getTime());
        Glide.with(context).load(iAtme.getCoverPath()).placeholder(R.drawable.icon_user_head).into(videoCoverIV);
        descripTV.setText(iAtme.getAtStr());
    }
}
